package org.vectrics.domain.struts;

import java.util.Collection;
import java.util.Iterator;
import org.vectrics.common.html.Combo;
import org.vectrics.domain.Domain;
import org.vectrics.provider.CoreServiceLocator;
import org.vectrics.struts.VectricsComboTag;

public class DomainComboTag extends VectricsComboTag {
	
	
	public DomainComboTag() {
		super();
	}

	protected void makeOptions(Combo combo) {
		Collection domains = CoreServiceLocator.getSystemService().findAllDomains();
		Iterator iter = domains.iterator();
		while (iter.hasNext()) {
			Domain domain = (Domain)iter.next();
			Long id = domain.getId();
			String description = domain.getDescription();
			combo.addOption(description, id.toString());
		}
	}

}
